from typing import Type, Dict
from .template import StrategyTemplate
from .strategies.atr_rsi_strategy import AtrRsiStrategy
from .strategies.fundamental_value_strategy import FundamentalValueStrategy

STRATEGY_CLASS_MAP: Dict[str, Type[StrategyTemplate]] = {
    "AtrRsiStrategy": AtrRsiStrategy,
    "FundamentalValueStrategy": FundamentalValueStrategy
}

def load_strategy(strategy_name: str) -> Type[StrategyTemplate]:
    """
    加载交易策略
    """
    strategy_class = STRATEGY_CLASS_MAP.get(strategy_name)
    if not strategy_class:
        raise ValueError(f"找不到策略：{strategy_name}")
    return strategy_class 